package com.hyk.commonLib.common.utils;

import org.apache.commons.lang3.tuple.ImmutablePair;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 贺玉琨 on 2019/10/24.
 */
public class MapUtils {
    @SafeVarargs
    public static <T, K> Map<T, K> asMap(ImmutablePair<T, K>... pairs) {
        Map<T, K> map = new HashMap<>();
        for (ImmutablePair<T, K> pair : pairs) {
            map.put(pair.getKey(), pair.getValue());
        }
        return map;
    }
}
